package PriorityQueue;

import java.util.PriorityQueue;

public class Test {
    public static void main(String[] args) {
        int [] arr = {12,9,17,27,35,65};
        PriorityQueue p = new PriorityQueue(new IntCmp());
        for (int x:arr){
            p.offer(x);
        }
        System.out.println(p.size());
        System.out.println(p.peek());
        p.poll();
        System.out.println(p.size());
        System.out.println(p.peek());
    }
    public static void main2(String[] args) {
        PriorityQueue priorityQueue = new PriorityQueue<>( new IntCmp());
        priorityQueue.offer(12);
        priorityQueue.offer(34);
        priorityQueue.offer(65);
        priorityQueue.offer(23);
        priorityQueue.offer(9);
        priorityQueue.offer(98);
        priorityQueue.offer(76);
        System.out.println(priorityQueue.peek());
    }
    public static void main1(String[] args) {
        int [] arr = {27,15,19,18,28,34,65,49,25,37};
        TestHeap testHeap = new TestHeap();
        testHeap.initElem(arr);
        testHeap.creatHeap();//O(N)
        testHeap.heapSort();
        System.out.println(testHeap.poll());
        System.out.println("=============");
        MyPriorityQueue myPriorityQueue = new MyPriorityQueue();
        int [] array = {12,45,54,76,65,98,9,24,35,88};
        myPriorityQueue.intiArr(array);
        System.out.println(myPriorityQueue.poll());



    }
}
